package app;

import engine.ReadXMLFile;
import engine.SvgObjects;
import gui.MainFrame;

public class Application
{
    public static void main(String[] args)
    {
        
        // create and starts to read svg File and ready to read
        ReadXMLFile rd = new ReadXMLFile();
        
        if (args.length != 1)
        {
            
            System.out.println("Error...Invalid Number of arguments ");
            System.exit(0);
            
        }
        
        rd.readIn(args[0]);
        SvgObjects ob = rd.getObjectsss();
        
        // testing purposes only prints all object in arraylists
        // /////////////////////////////////////////////////////////////////////
        ob.printGridSizeData();
        
        System.out.println("-----------------------");
        
        for (int k = 0; k < ob.getCircles().size(); k++)
        {
            
            ob.getCircles().get(k).print();
            System.out.println("-----------------------");
        }
        
        for (int k = 0; k < ob.getRectangles().size(); k++)
        {
            
            ob.getRectangles().get(k).print();
            System.out.println("-----------------------");
        }
        
        for (int k = 0; k < ob.getLines().size(); k++)
        {
            
            ob.getLines().get(k).print();
            System.out.println("-----------------------");
        }
        // /////////////////////////////////////////////////////////////////////
        
        MainFrame frame = new MainFrame();
        frame.setTitle("SVG READER");
        frame.getJContentPanel().addOB(ob);
        frame.setVisible(true);
        
    }
    
}